package com.algorithm.commonsort;

import java.util.Scanner;

/**
/**
 * Created with IntelliJ IDEA.
 * User: LK
 * Date: 2018/4/9
 * Time: 19:29
 * To change this template use File | Settings | File Templates.
 * Description: 
 */
public class test {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int total = 0 ;
        if(scan.hasNextInt()){                 // 判断输入的是否是整数
            total = scan.nextInt() ;
        }
//        long[] number = new long[total];
        String[] result = new String[total];
        for(int i= 0;i<total;i++){
//                number[i] = scan.nextLong();
                result[i] = getFactorsFromNum(scan.nextLong());
        }

        for(int i= 0;i<total;i++){
            System.out.println(result[i]);
        }
    }

    public static String getFactorsFromNum(long number) {

        long evenNumber = 2;
        for(;evenNumber<=number;){

            long divisor = number/evenNumber;
            long product = number%evenNumber;
            long divisorSurplus = divisor%2;
            //可以除尽并且divisor是奇数
            if (product == 0 && divisorSurplus == 1) {
                return divisor+" "+evenNumber;
            }

            evenNumber +=2;

        }
        return "No";
    }
}
